import {RouteRecordRaw} from "vue-router";

export const constantRoutes: RouteRecordRaw[] = [
    {
        name: 'login',
        path: '/login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            title: '登录',
            hidden: true
        }
    },
    {
        name: 'layout',
        path: '/',
        component: () => import('@/layout/index.vue'),
        redirect: '/home',
        meta: {
            hidden: false
        },
        children: [
            {
                name: 'home',
                path: '/home',
                component: () => import('@/views/home/index.vue'),
                meta: {
                    icon: 'HomeFilled',
                    title: '首页',
                    hidden: false
                }
            },
        ]
    },
    {
        name: 'screen',
        path: '/screen',
        component: () => import('@/views/screen/index.vue'),
        meta: {
            title: '大屏',
            hidden: false,
            icon: 'Monitor'
        }
    },
    {
        name: 'acl',
        path: '/acl',
        component: () => import('@/layout/index.vue'),
        meta: {
            title: '权限管理',
            hidden: false,
            icon: 'Lock'
        },
        children: [
            {
                name: 'user',
                path: '/acl/user',
                component: () => import('@/views/acl/user/index.vue'),
                meta: {
                    title: '用户管理',
                    hidden: false,
                    icon: 'User'
                }
            },
            {
                name: 'role',
                path: '/acl/role',
                component: () => import('@/views/acl/role/index.vue'),
                meta: {
                    title: '角色管理',
                    hidden: false,
                    icon: 'UserFilled'
                }
            },
            {
                name: 'permission',
                path: '/acl/permission',
                component: () => import('@/views/acl/permission/index.vue'),
                meta: {
                    title: '菜单管理',
                    hidden: false,
                    icon: 'Grid'
                }
            }
        ]
    },
    {
        path: '/product',
        component: () => import('@/layout/index.vue'),
        meta: {
            title: '商品管理',
            hidden: false,
            icon: 'Goods'
        },
        children: [
            {
                name: 'trademark',
                path: '/product/trademark',
                component: () => import('@/views/product/trademark/index.vue'),
                meta: {
                    title: '品牌管理',
                    hidden: false,
                    icon: 'ShoppingCartFull'
                }
            },
            {
                name: 'attr',
                path: '/product/attr',
                component: () => import('@/views/product/attr/index.vue'),
                meta: {
                    title: '属性管理',
                    hidden: false,
                    icon: 'ChromeFilled'
                }
            },
            {
                name: 'spu',
                path: '/product/spu',
                component: () => import('@/views/product/spu/index.vue'),
                meta: {
                    title: 'SPU管理',
                    hidden: false,
                    icon: 'Calendar'
                }
            },
            {
                name: 'sku',
                path: '/product/sku',
                component: () => import('@/views/product/sku/index.vue'),
                meta: {
                    title: 'SKU管理',
                    hidden: false,
                    icon: 'Orange'
                }
            }
        ]
    },
    {
        name: '404',
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        meta: {
            title: '404',
            hidden: true
        }
    },
    {
        name: 'any',
        // 匹配所有路径
        path: '/:pathMatch(.*)*',
        // 重定向到404页面
        redirect: '/404',
        meta: {
            title: '任意路由',
            hidden: true
        }
    }
]